import Vue from 'vue'
import App from './App.vue'


//加载路由配置文件
import router from './router/index.js';

//加载中间件
import store from './store/base.js';

//加载swper插件
import VueAwesomeSwiper from 'vue-awesome-swiper'
import './assets/css/swiper.min.css'
//应用swiper插件
Vue.use(VueAwesomeSwiper)

//加载弹窗插件
import { Alert, Confirm, Toast } from 'wc-messagebox';
//样式
import 'wc-messagebox/style.css';
Vue.use(Alert);
Vue.use(Confirm);
Vue.use(Toast);

//百度地图
import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, { ak: 'WSwzbIdIsG2S92XvXpl9OPTPrj49P8K8' })


//加载异步请求数据
import axios from 'axios';
// 通过原型对象prototype，定义属性$axios
// Vue.use(axios);
Vue.prototype.$axios = axios;
//全局的组件使用


router.beforeEach((to, from, next) => {
    //页面加载时改变标题
    if (to.meta.title) {
        document.title = to.meta.title
    }
    next();

})


Vue.config.productionTip = false

new Vue({
    store,
    router: router,
    render: h => h(App),
}).$mount('#app')